Optimal. Leaf size=123 \[ \frac {4 d (c+d x) \cos (a+b x)}{3 b^2}+\frac {2 d (c+d x) \cos ^3(a+b x)}{9 b^2}-\frac {14 d^2 \sin (a+b x)}{9 b^3}+\frac {2 (c+d x)^2 \sin (a+b x)}{3 b}+\frac {(c+d x)^2 \cos ^2(a+b x) \sin (a+b x)}{3 b}+\frac {2 d^2 \sin ^3(a+b x)}{27 b^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 123, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 4, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3392, 3377,
2717, 2713} \begin {gather*} \frac {2 d^2 \sin ^3(a+b x)}{27 b^3}-\frac {14 d^2 \sin (a+b x)}{9 b^3}+\frac {2 d (c+d x) \cos ^3(a+b x)}{9 b^2}+\frac {4 d (c+d x) \cos (a+b x)}{3 b^2}+\frac {2 (c+d x)^2 \sin (a+b x)}{3 b}+\frac {(c+d x)^2 \sin (a+b x) \cos ^2(a+b x)}{3 b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2713
Rule 2717
Rule 3377
Rule 3392
Rubi steps
\begin {align*} \int (c+d x)^2 \cos ^3(a+b x) \, dx &=\frac {2 d (c+d x) \cos ^3(a+b x)}{9 b^2}+\frac {(c+d x)^2 \cos ^2(a+b x) \sin (a+b x)}{3 b}+\frac {2}{3} \int (c+d x)^2 \cos (a+b x) \, dx-\frac {\left (2 d^2\right ) \int \cos ^3(a+b x) \, dx}{9 b^2}\\ &=\frac {2 d (c+d x) \cos ^3(a+b x)}{9 b^2}+\frac {2 (c+d x)^2 \sin (a+b x)}{3 b}+\frac {(c+d x)^2 \cos ^2(a+b x) \sin (a+b x)}{3 b}-\frac {(4 d) \int (c+d x) \sin (a+b x) \, dx}{3 b}+\frac {\left (2 d^2\right ) \text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (a+b x)\right )}{9 b^3}\\ &=\frac {4 d (c+d x) \cos (a+b x)}{3 b^2}+\frac {2 d (c+d x) \cos ^3(a+b x)}{9 b^2}-\frac {2 d^2 \sin (a+b x)}{9 b^3}+\frac {2 (c+d x)^2 \sin (a+b x)}{3 b}+\frac {(c+d x)^2 \cos ^2(a+b x) \sin (a+b x)}{3 b}+\frac {2 d^2 \sin ^3(a+b x)}{27 b^3}-\frac {\left (4 d^2\right ) \int \cos (a+b x) \, dx}{3 b^2}\\ &=\frac {4 d (c+d x) \cos (a+b x)}{3 b^2}+\frac {2 d (c+d x) \cos ^3(a+b x)}{9 b^2}-\frac {14 d^2 \sin (a+b x)}{9 b^3}+\frac {2 (c+d x)^2 \sin (a+b x)}{3 b}+\frac {(c+d x)^2 \cos ^2(a+b x) \sin (a+b x)}{3 b}+\frac {2 d^2 \sin ^3(a+b x)}{27 b^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.39, size = 93, normalized size = 0.76 \begin {gather*} \frac {162 b d (c+d x) \cos (a+b x)+6 b d (c+d x) \cos (3 (a+b x))+2 \left (-82 d^2+45 b^2 (c+d x)^2+\left (-2 d^2+9 b^2 (c+d x)^2\right ) \cos (2 (a+b x))\right ) \sin (a+b x)}{108 b^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(264\) vs.
\(2(111)=222\).
time = 0.14, size = 265, normalized size = 2.15
method | result | size |
risch | \(\frac {3 d \left (d x +c \right ) \cos \left (b x +a \right )}{2 b^{2}}+\frac {3 \left (d^{2} x^{2} b^{2}+2 b^{2} c d x +b^{2} c^{2}-2 d^{2}\right ) \sin \left (b x +a \right )}{4 b^{3}}+\frac {d \left (d x +c \right ) \cos \left (3 b x +3 a \right )}{18 b^{2}}+\frac {\left (9 d^{2} x^{2} b^{2}+18 b^{2} c d x +9 b^{2} c^{2}-2 d^{2}\right ) \sin \left (3 b x +3 a \right )}{108 b^{3}}\) | \(128\) |
derivativedivides | \(\frac {\frac {a^{2} d^{2} \left (2+\cos ^{2}\left (b x +a \right )\right ) \sin \left (b x +a \right )}{3 b^{2}}-\frac {2 a c d \left (2+\cos ^{2}\left (b x +a \right )\right ) \sin \left (b x +a \right )}{3 b}-\frac {2 a \,d^{2} \left (\frac {\left (b x +a \right ) \left (2+\cos ^{2}\left (b x +a \right )\right ) \sin \left (b x +a \right )}{3}+\frac {\left (\cos ^{3}\left (b x +a \right )\right )}{9}+\frac {2 \cos \left (b x +a \right )}{3}\right )}{b^{2}}+\frac {c^{2} \left (2+\cos ^{2}\left (b x +a \right )\right ) \sin \left (b x +a \right )}{3}+\frac {2 c d \left (\frac {\left (b x +a \right ) \left (2+\cos ^{2}\left (b x +a \right )\right ) \sin \left (b x +a \right )}{3}+\frac {\left (\cos ^{3}\left (b x +a \right )\right )}{9}+\frac {2 \cos \left (b x +a \right )}{3}\right )}{b}+\frac {d^{2} \left (\frac {\left (b x +a \right )^{2} \left (2+\cos ^{2}\left (b x +a \right )\right ) \sin \left (b x +a \right )}{3}-\frac {4 \sin \left (b x +a \right )}{3}+\frac {4 \left (b x +a \right ) \cos \left (b x +a \right )}{3}+\frac {2 \left (b x +a \right ) \left (\cos ^{3}\left (b x +a \right )\right )}{9}-\frac {2 \left (2+\cos ^{2}\left (b x +a \right )\right ) \sin \left (b x +a \right )}{27}\right )}{b^{2}}}{b}\) | \(265\) |
default | \(\frac {\frac {a^{2} d^{2} \left (2+\cos ^{2}\left (b x +a \right )\right ) \sin \left (b x +a \right )}{3 b^{2}}-\frac {2 a c d \left (2+\cos ^{2}\left (b x +a \right )\right ) \sin \left (b x +a \right )}{3 b}-\frac {2 a \,d^{2} \left (\frac {\left (b x +a \right ) \left (2+\cos ^{2}\left (b x +a \right )\right ) \sin \left (b x +a \right )}{3}+\frac {\left (\cos ^{3}\left (b x +a \right )\right )}{9}+\frac {2 \cos \left (b x +a \right )}{3}\right )}{b^{2}}+\frac {c^{2} \left (2+\cos ^{2}\left (b x +a \right )\right ) \sin \left (b x +a \right )}{3}+\frac {2 c d \left (\frac {\left (b x +a \right ) \left (2+\cos ^{2}\left (b x +a \right )\right ) \sin \left (b x +a \right )}{3}+\frac {\left (\cos ^{3}\left (b x +a \right )\right )}{9}+\frac {2 \cos \left (b x +a \right )}{3}\right )}{b}+\frac {d^{2} \left (\frac {\left (b x +a \right )^{2} \left (2+\cos ^{2}\left (b x +a \right )\right ) \sin \left (b x +a \right )}{3}-\frac {4 \sin \left (b x +a \right )}{3}+\frac {4 \left (b x +a \right ) \cos \left (b x +a \right )}{3}+\frac {2 \left (b x +a \right ) \left (\cos ^{3}\left (b x +a \right )\right )}{9}-\frac {2 \left (2+\cos ^{2}\left (b x +a \right )\right ) \sin \left (b x +a \right )}{27}\right )}{b^{2}}}{b}\) | \(265\) |
norman | \(\frac {\frac {4 c d \left (\tan ^{4}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{b^{2}}+\frac {28 c d}{9 b^{2}}+\frac {14 d^{2} x}{9 b^{2}}+\frac {4 \left (9 b^{2} c^{2}-38 d^{2}\right ) \left (\tan ^{3}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{27 b^{3}}+\frac {2 \left (9 b^{2} c^{2}-14 d^{2}\right ) \tan \left (\frac {b x}{2}+\frac {a}{2}\right )}{9 b^{3}}+\frac {2 \left (9 b^{2} c^{2}-14 d^{2}\right ) \left (\tan ^{5}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{9 b^{3}}+\frac {16 c d \left (\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{3 b^{2}}+\frac {2 d^{2} x^{2} \tan \left (\frac {b x}{2}+\frac {a}{2}\right )}{b}+\frac {4 d^{2} x^{2} \left (\tan ^{3}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{3 b}+\frac {2 d^{2} x^{2} \left (\tan ^{5}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{b}+\frac {2 d^{2} x \left (\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{3 b^{2}}-\frac {2 d^{2} x \left (\tan ^{4}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{3 b^{2}}-\frac {14 d^{2} x \left (\tan ^{6}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{9 b^{2}}+\frac {4 c d x \tan \left (\frac {b x}{2}+\frac {a}{2}\right )}{b}+\frac {8 c d x \left (\tan ^{3}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{3 b}+\frac {4 c d x \left (\tan ^{5}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{b}}{\left (1+\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )^{3}}\) | \(337\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 267 vs.
\(2 (111) = 222\).
time = 0.31, size = 267, normalized size = 2.17 \begin {gather*} -\frac {36 \, {\left (\sin \left (b x + a\right )^{3} - 3 \, \sin \left (b x + a\right )\right )} c^{2} - \frac {72 \, {\left (\sin \left (b x + a\right )^{3} - 3 \, \sin \left (b x + a\right )\right )} a c d}{b} + \frac {36 \, {\left (\sin \left (b x + a\right )^{3} - 3 \, \sin \left (b x + a\right )\right )} a^{2} d^{2}}{b^{2}} - \frac {6 \, {\left (3 \, {\left (b x + a\right )} \sin \left (3 \, b x + 3 \, a\right ) + 27 \, {\left (b x + a\right )} \sin \left (b x + a\right ) + \cos \left (3 \, b x + 3 \, a\right ) + 27 \, \cos \left (b x + a\right )\right )} c d}{b} + \frac {6 \, {\left (3 \, {\left (b x + a\right )} \sin \left (3 \, b x + 3 \, a\right ) + 27 \, {\left (b x + a\right )} \sin \left (b x + a\right ) + \cos \left (3 \, b x + 3 \, a\right ) + 27 \, \cos \left (b x + a\right )\right )} a d^{2}}{b^{2}} - \frac {{\left (6 \, {\left (b x + a\right )} \cos \left (3 \, b x + 3 \, a\right ) + 162 \, {\left (b x + a\right )} \cos \left (b x + a\right ) + {\left (9 \, {\left (b x + a\right )}^{2} - 2\right )} \sin \left (3 \, b x + 3 \, a\right ) + 81 \, {\left ({\left (b x + a\right )}^{2} - 2\right )} \sin \left (b x + a\right )\right )} d^{2}}{b^{2}}}{108 \, b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 128, normalized size = 1.04 \begin {gather*} \frac {6 \, {\left (b d^{2} x + b c d\right )} \cos \left (b x + a\right )^{3} + 36 \, {\left (b d^{2} x + b c d\right )} \cos \left (b x + a\right ) + {\left (18 \, b^{2} d^{2} x^{2} + 36 \, b^{2} c d x + 18 \, b^{2} c^{2} + {\left (9 \, b^{2} d^{2} x^{2} + 18 \, b^{2} c d x + 9 \, b^{2} c^{2} - 2 \, d^{2}\right )} \cos \left (b x + a\right )^{2} - 40 \, d^{2}\right )} \sin \left (b x + a\right )}{27 \, b^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 284 vs.
\(2 (121) = 242\).
time = 0.34, size = 284, normalized size = 2.31 \begin {gather*} \begin {cases} \frac {2 c^{2} \sin ^{3}{\left (a + b x \right )}}{3 b} + \frac {c^{2} \sin {\left (a + b x \right )} \cos ^{2}{\left (a + b x \right )}}{b} + \frac {4 c d x \sin ^{3}{\left (a + b x \right )}}{3 b} + \frac {2 c d x \sin {\left (a + b x \right )} \cos ^{2}{\left (a + b x \right )}}{b} + \frac {2 d^{2} x^{2} \sin ^{3}{\left (a + b x \right )}}{3 b} + \frac {d^{2} x^{2} \sin {\left (a + b x \right )} \cos ^{2}{\left (a + b x \right )}}{b} + \frac {4 c d \sin ^{2}{\left (a + b x \right )} \cos {\left (a + b x \right )}}{3 b^{2}} + \frac {14 c d \cos ^{3}{\left (a + b x \right )}}{9 b^{2}} + \frac {4 d^{2} x \sin ^{2}{\left (a + b x \right )} \cos {\left (a + b x \right )}}{3 b^{2}} + \frac {14 d^{2} x \cos ^{3}{\left (a + b x \right )}}{9 b^{2}} - \frac {40 d^{2} \sin ^{3}{\left (a + b x \right )}}{27 b^{3}} - \frac {14 d^{2} \sin {\left (a + b x \right )} \cos ^{2}{\left (a + b x \right )}}{9 b^{3}} & \text {for}\: b \neq 0 \\\left (c^{2} x + c d x^{2} + \frac {d^{2} x^{3}}{3}\right ) \cos ^{3}{\left (a \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.46, size = 137, normalized size = 1.11 \begin {gather*} \frac {{\left (b d^{2} x + b c d\right )} \cos \left (3 \, b x + 3 \, a\right )}{18 \, b^{3}} + \frac {3 \, {\left (b d^{2} x + b c d\right )} \cos \left (b x + a\right )}{2 \, b^{3}} + \frac {{\left (9 \, b^{2} d^{2} x^{2} + 18 \, b^{2} c d x + 9 \, b^{2} c^{2} - 2 \, d^{2}\right )} \sin \left (3 \, b x + 3 \, a\right )}{108 \, b^{3}} + \frac {3 \, {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2} - 2 \, d^{2}\right )} \sin \left (b x + a\right )}{4 \, b^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.59, size = 173, normalized size = 1.41 \begin {gather*} \frac {\frac {d^2\,x\,\cos \left (3\,a+3\,b\,x\right )}{18}+\frac {3\,c\,d\,\cos \left (a+b\,x\right )}{2}+\frac {c\,d\,\cos \left (3\,a+3\,b\,x\right )}{18}+\frac {3\,d^2\,x\,\cos \left (a+b\,x\right )}{2}}{b^2}+\frac {\frac {3\,c^2\,\sin \left (a+b\,x\right )}{4}+\frac {c^2\,\sin \left (3\,a+3\,b\,x\right )}{12}+\frac {3\,d^2\,x^2\,\sin \left (a+b\,x\right )}{4}+\frac {d^2\,x^2\,\sin \left (3\,a+3\,b\,x\right )}{12}+\frac {3\,c\,d\,x\,\sin \left (a+b\,x\right )}{2}+\frac {c\,d\,x\,\sin \left (3\,a+3\,b\,x\right )}{6}}{b}-\frac {3\,d^2\,\sin \left (a+b\,x\right )}{2\,b^3}-\frac {d^2\,\sin \left (3\,a+3\,b\,x\right )}{54\,b^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________